using System;
using System.Collections.Generic;
using System.Text;

namespace LogParser.DA
{
    public class ObjectListModel
    {

        private DataObjects.ObjectsDSTableAdapters.ObjectsTableAdapter ota;

        public ObjectListModel()
        {
            Initialize();
        }

        private void Initialize()
        {
            ota = TableAdapters.ObjectsTableAdapter();
        }

        public List<GameObjects.Object> GetObjectList()
        {

            List<GameObjects.Object> returnList = new List<LogParser.GameObjects.Object>();

            DA.DataObjects.ObjectsDS.ObjectsDataTable odt = ota.GetData();

            foreach ( DA.DataObjects.ObjectsDS.ObjectsRow dr in odt.Rows )
            {
                GameObjects.Object tempObject = new LogParser.GameObjects.Object();
                tempObject.ID = dr.ObjectId;
                tempObject.ShortName = dr.ObjectShortName;
                tempObject.LongName = dr.ObjectLongName;

                returnList.Add( tempObject );
            }

            return returnList;

        }

    }
}
